<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>

        <p>{{time |aa('YYYY-MM-DD  hh:mm:ss','123')}}</p>
        <p>{{msg |bb}}</p>
    </div>
    <script type='text/javascript'>

        Vue.filter('aa',function(msg,pp,uuu){
             console.log(pp,888);
            
            // return msg.replace('Vue','World')
            var  y=msg.getFullYear()
            var  m=msg.getMonth()
            var  d=msg.getDate()

            var  hh=msg.getHours()
            var  mm=msg.getMinutes()
            var  ss=msg.getSeconds()

            if(pp=='YYYY-MM-DD'){
                return  `${y}-${m}-${d}`
            }
            return  `${y}-${m}-${d}  ${hh}:${mm}:${ss}=====`
        })

        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                time:new  Date()
            },
            filters:{
                bb(qqq){
                    return qqq.replace('Vue','World')
                }
            }
        });
    </script>
</body>
</html>